/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Day09_Ex3_generics2;

/**
 *
 * @author Mark
 */
public class Example1 {


    /**
     * simple example that demonstrates method overloading
     */
    public static void main(String[] args)
    {

        Integer[] iray = {1, 2, 3, 4};
        String[] sray = {"Apple", "Pear", "Orange"};

        outputArray(iray);
        outputArray(sray);

    }

    //example of method overloading
    private static void outputArray(Integer[] iray)
    {
        for (int i = 0; i < iray.length; i++) {
            System.out.print(iray[i] + " ");
        }
        System.out.println("");

    }

    private static void outputArray(String[] s)
    {
        //enhanced for loop
        for (String string : s)
        {
            System.out.print(string + " ");
        }
        System.out.println("");
    }
}
